package com.dapeng.cleardatabackend.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dapeng.cleardatabackend.model.dto.graph.GraphAddRequest;
import com.dapeng.cleardatabackend.model.dto.graph.GraphGetRequest;
import com.dapeng.cleardatabackend.model.dto.graph.GraphSearchRequest;
import com.dapeng.cleardatabackend.model.dto.graph.GraphUpdateRequest;
import com.dapeng.cleardatabackend.model.entity.Graph;
import com.dapeng.cleardatabackend.model.vo.GraphVO;
import com.dapeng.cleardatabackend.model.vo.graphdetail.GraphDetailVO;
import org.springframework.transaction.annotation.Transactional;

/**
* @author dapeng
* @description 针对表【graph(图谱表)】的数据库操作Service
* @createDate 2024-12-22 13:29:10
*/
public interface GraphService extends IService<Graph> {

    /**
     * 创建图谱
     *
     * @param graphAddRequest 添加图谱请求
     * @return {@link Long }
     */
    Long createGraph(GraphAddRequest graphAddRequest);

    /**
     * 删除图谱
     *
     * @param id id
     * @return boolean
     */
    boolean deleteGraph(Long id);

    /**
     * 更新图谱
     *
     * @param graphUpdateRequest 更新图谱请求
     */
    void updateGraph(GraphUpdateRequest graphUpdateRequest);

    /**
     * 获取图谱分页数据
     *
     * @param graphGetRequest 获取图谱请求
     * @return {@link Page }<{@link GraphVO }>
     */
    Page<GraphVO> getMyGraphPage(GraphGetRequest graphGetRequest);

    /**
     * 获取公开图谱页面
     *
     * @param graphGetRequest 获取图谱请求
     * @return {@link Page }<{@link GraphVO }>
     */
    Page<GraphVO> getPublicGraphPage(GraphGetRequest graphGetRequest);

    /**
     * 搜索图
     *
     * @param graphSearchRequest 搜索图请求
     * @return {@link GraphDetailVO }
     */
    GraphDetailVO searchGraph(GraphSearchRequest graphSearchRequest);

    /**
     * 清除创建失败的图谱
     */
    void clearFailCreate();

    /**
     * 删除未使用索引
     */
    void deleteUnUsedIndex();
}
